
var i,j;
document.write('<table>');
for(i=1;i<10;i++){
	document.write('<tr>')
	for(j=1;j<i+1;j++){
		if (j%2!=0) {
			document.write('<td style="background:red;">');
		}
		else{
			if (i%2!=0) {
				document.write('<td style="background:blue;">');
			}else{document.write('<td style="background:gray;">');}
		};
		document.write(+j+'x'+i+'='+i*j+'</td>');
	}
	document.write('</tr>')
}
document.write('</table>');